<html>
<head>
<title>Hello Ajax version 1</title>
<style type='text/css'>
* {
	font-family: Tahoma, Arial, sans-serif;
}

#helloTitle {
	color: #48f;
	font-size: 1.5em;
}
</style>
<script type='text/javascript' src='../../js/prototype/prototype.js'></script>
<script type='text/javascript'>
	window.onload = function() {
		document.getElementById('helloBtn').onclick = function() {
			var name = document.getElementById('helloTxt').value;
			new Ajax.Request(
					"hello1.jsp?name=" + encodeURI(name),
					{
						method : "get",
						onComplete : function(response) {
							document.getElementById('helloTitle').innerHTML = response.responseText;
						}
					});
		}
	}
</script>
</head>
<body>
	<h1 id='helloTitle'>Hello, stranger</h1>
	<p>Please introduce yourself by entering your name in the box below</p>
	<input type='text' size='24' id='helloTxt'></input>&nbsp;
	<button id='helloBtn'>Submit</button>
</body>
</html>
